﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/AdminDefault.Master"
  AutoEventWireup="true" CodeBehind="ProductList.aspx.cs" Inherits="NguyenHoa.Web.Admin.ProductList" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <div>
    <dxwgv:ASPxGridView ID="gvList" runat="server" AutoGenerateColumns="False" ClientInstanceName="gvList"
      KeyFieldName="Id" Width="100%" OnCustomJSProperties="gvList_CustomJSProperties"
      OnRowDeleting="gvList_RowDeleting" OnRowInserting="gvList_RowInserting" OnRowUpdating="gvList_RowUpdating"
      OnCellEditorInitialize="gvList_CellEditorInitialize" OnCustomCallback="gvList_CustomCallback"
      OnCommandButtonInitialize="gvList_CommandButtonInitialize">
      <SettingsBehavior ConfirmDelete="True" />
      <Styles>
        <Header ImageSpacing="5px" SortingImageSpacing="5px">
        </Header>
      </Styles>
      <SettingsPager>
        <AllButton>
          <Image Height="19px" Width="28px" />
        </AllButton>
        <FirstPageButton>
          <Image Height="19px" Width="23px" />
        </FirstPageButton>
        <LastPageButton>
          <Image Height="19px" Width="23px" />
        </LastPageButton>
        <NextPageButton>
          <Image Height="19px" Width="19px" />
        </NextPageButton>
        <PrevPageButton>
          <Image Height="19px" Width="19px" />
        </PrevPageButton>
        <Summary AllPagesText="<%$Resources:Strings, PagerText %>" Text="<%$Resources:Strings, PagerText %>" />
      </SettingsPager>
      <Columns>
        <dxwgv:GridViewCommandColumn ButtonType="Image" VisibleIndex="0" Width="60px" Caption=" ">
          <EditButton Visible="True">
            <Image Url="~/images/edit.png" />
          </EditButton>
          <NewButton Visible="True">
            <Image Url="~/images/add.png" />
          </NewButton>
          <DeleteButton Visible="True">
            <Image Url="~/images/delete.png" />
          </DeleteButton>
          <CancelButton>
            <Image Url="~/images/undo.gif" />
          </CancelButton>
          <UpdateButton>
            <Image Url="~/images/save.png" />
          </UpdateButton>
          <HeaderStyle HorizontalAlign="Center" />
          <CellStyle Cursor="pointer">
          </CellStyle>
        </dxwgv:GridViewCommandColumn>
        <dxwgv:GridViewDataTextColumn VisibleIndex="0" FieldName="Code" 
          Caption="<%$Resources: Strings, Code %>" ReadOnly="True">
          <HeaderStyle HorizontalAlign="Center" />
          <CellStyle HorizontalAlign="Center">
          </CellStyle>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn Caption="<%$ Resources:Strings, Name %>" FieldName="Name"
          VisibleIndex="2">
          <EditFormSettings Visible="True" VisibleIndex="0" />
          <HeaderStyle HorizontalAlign="Center" />
          <CellStyle HorizontalAlign="Left">
          </CellStyle>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataDateColumn FieldName="CreatedDate" VisibleIndex="2" Caption="<%$ Resources:Strings, CreatedDate %>">
          <HeaderStyle HorizontalAlign="Center" />
          <CellStyle HorizontalAlign="Center">
          </CellStyle>
          <EditFormSettings VisibleIndex="2" />
        </dxwgv:GridViewDataDateColumn>
        <dxwgv:GridViewDataTextColumn FieldName="CreatedBy" VisibleIndex="4" Caption="<%$ Resources:Strings, CreatedBy %>">
          <HeaderStyle HorizontalAlign="Center" />
          <EditFormSettings Visible="True" VisibleIndex="3" />
          <CellStyle HorizontalAlign="Center">
          </CellStyle>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataDateColumn VisibleIndex="5" FieldName="ModifiedDate" Caption="<%$ Resources:Strings, ModifiedDate %>">
          <HeaderStyle HorizontalAlign="Center" />
          <CellStyle HorizontalAlign="Center">
          </CellStyle>
          <EditFormSettings VisibleIndex="4" />
        </dxwgv:GridViewDataDateColumn>
        <dxwgv:GridViewDataTextColumn VisibleIndex="6">
          <EditFormSettings Visible="False" VisibleIndex="5" />
          <DataItemTemplate>
            <span><a style="cursor: pointer;" onclick="ViewDetail('<%#Eval("Id") %>')">
              <asp:Label ID="Label1" runat="server" Text="<%$Resources:Strings,ViewDetail %>"></asp:Label></a>
            </span>
          </DataItemTemplate>
          <CellStyle HorizontalAlign="Center">
          </CellStyle>
        </dxwgv:GridViewDataTextColumn>
      </Columns>
      <StylesEditors>
        <ProgressBar Height="29px">
        </ProgressBar>
      </StylesEditors>
      <ImagesEditors>
        <CalendarPrevYear Height="19px" Width="23px" />
        <CalendarPrevMonth Height="19px" Width="19px" />
        <CalendarNextMonth Height="19px" Width="19px" />
        <CalendarNextYear Height="19px" Width="23px" />
      </ImagesEditors>
      <SettingsText ConfirmDelete="<%$Resources: Messages, ERR0006 %>" />
      <ClientSideEvents EndCallback="function(s, e){gvList_EndCallback(s,e);}" />
    </dxwgv:ASPxGridView>
  </div>
  <div>

    <script type="text/javascript" language="javascript">
      function gvList_EndCallback(s, e) {
        var error = gvList.cpInnerError;
        if (error != '') {
          alertMessage(error.split('|')[1]);
        }
      }
      function ViewDetail(id) {
        window.location.href = "ProductDetail.aspx?id=" + id;
      }
      function cbbFilterCat_ValueChanged() {
        gvList.PerformCallback("filter");
      }
    </script>

  </div>
</asp:Content>
